/*
Copyright 2014, KISSY v1.47
MIT Licensed
build time: May 22 12:15
*/
KISSY.add("anim/base/queue",["dom"],function(c,i){function h(a,b,c){var b=b||f,j,m=d.data(a,g);!m&&!c&&d.data(a,g,m={});m&&(j=m[b],!j&&!c&&(j=m[b]=[]));return j}var d=i("dom"),g=c.guid("ks-queue-"+c.now()+"-"),f=c.guid("ks-queue-"+c.now()+"-"),a;return a={queueCollectionKey:g,queue:function(a,c,d){a=h(a,c);a.push(d);return a},remove:function(e,b,d){var j=h(e,b,1);j&&(d=c.indexOf(d,j),-1<d&&j.splice(d,1));j&&!j.length&&a.clearQueue(e,b);return j},clearQueues:function(a){d.removeData(a,g)},clearQueue:function(a,
b){var b=b||f,l=d.data(a,g);l&&delete l[b];c.isEmptyObject(l)&&d.removeData(a,g)},dequeue:function(c,b){var d=h(c,b,1);d&&(d.shift(),d.length||a.clearQueue(c,b));return d}}});
KISSY.add("anim/base/utils",["./queue","dom"],function(c,i){var h=i("./queue"),d=i("dom"),g=c.guid("ks-anim-unqueued-"+c.now()+"-"),f=c.guid("ks-anim-paused-"+c.now()+"-");return{saveRunningAnim:function(a){var e=a.node,b=d.data(e,g);b||d.data(e,g,b={});b[c.stamp(a)]=a},removeRunningAnim:function(a){var e=a.node,b=d.data(e,g);b&&(delete b[c.stamp(a)],c.isEmptyObject(b)&&d.removeData(e,g))},isAnimPaused:function(a){var e=d.data(a.node,f);return e?!!e[c.stamp(a)]:0},removePausedAnim:function(a){var e=
a.node,b=d.data(e,f);b&&(delete b[c.stamp(a)],c.isEmptyObject(b)&&d.removeData(e,f))},savePausedAnim:function(a){var e=a.node,b=d.data(e,f);b||d.data(e,f,b={});b[c.stamp(a)]=a},isAnimRunning:function(a){var e=d.data(a.node,g);return e?!!e[c.stamp(a)]:0},isElPaused:function(a){return(a=d.data(a,f))&&!c.isEmptyObject(a)},isElRunning:function(a){return(a=d.data(a,g))&&!c.isEmptyObject(a)},pauseOrResumeQueue:function(a,e,b){a=d.data(a,"resume"===b?f:g);a=c.merge(a);c.each(a,function(a){if(void 0===e||
a.config.queue===e)a[b]()})},stopEl:function(a,e,b,f){b&&(void 0===f?h.clearQueues(a):!1!==f&&h.clearQueue(a,f));a=d.data(a,g);a=c.merge(a);c.each(a,function(a){(void 0===f||a.config.queue===f)&&a.stop(e)})}}});
KISSY.add("anim/base",["dom","./base/utils","./base/queue","promise"],function(c,i){function h(j){h.superclass.constructor.call(this);a.Defer(this);this.config=j;var b=j.node;c.isPlainObject(b)||(b=d.get(j.node));this.node=this.el=b;this._backupProps={};this._propsData={}}var d=i("dom"),g=i("./base/utils"),f=i("./base/queue"),a=i("promise"),e=d.NodeType,b=c.noop,l={toggle:1,hide:1,show:1};c.extend(h,a,{on:function(a,c){"complete"===a?this.then(c):"end"===a?this.fin(c):"step"===a&&this.progress(c);
return this},prepareFx:b,runInternal:function(){var a=this,b=a.config,f=a.node,h,i=a._backupProps,o=a._propsData,k=b.to,r=b.delay||0,p=b.duration;g.saveRunningAnim(a);c.each(k,function(a,d){c.isPlainObject(a)||(a={value:a});o[d]=c.mix({delay:r,easing:b.easing,frame:b.frame,duration:p},a)});if(f.nodeType===e.ELEMENT_NODE){if(k.width||k.height)k=f.style,c.mix(i,{overflow:k.overflow,"overflow-x":k.overflowX,"overflow-y":k.overflowY}),k.overflow="hidden","inline"===d.css(f,"display")&&"none"===d.css(f,
"float")&&(10>c.UA.ieMode?k.zoom=1:k.display="inline-block");var q,n;n="none"===d.css(f,"display");c.each(o,function(c,b){h=c.value;if(l[h]){if("hide"===h&&n||"show"===h&&!n)return a.stop(!0),q=!1;i[b]=d.style(f,b);"toggle"===h&&(h=n?"show":"hide");"hide"===h?(c.value=0,i.display="none"):(c.value=d.css(f,b),d.css(f,b,0),d.show(f))}});if(!1===q)return}a.startTime=c.now();c.isEmptyObject(o)?(a.__totalTime=1E3*p,a.__waitTimeout=setTimeout(function(){a.stop(!0)},a.__totalTime)):(a.prepareFx(),a.doStart())},
isRunning:function(){return g.isAnimRunning(this)},isPaused:function(){return g.isAnimPaused(this)},pause:function(){this.isRunning()&&(this._runTime=c.now()-this.startTime,this.__totalTime-=this._runTime,g.removeRunningAnim(this),g.savePausedAnim(this),this.__waitTimeout?clearTimeout(this.__waitTimeout):this.doStop());return this},doStop:b,doStart:b,resume:function(){var a=this;a.isPaused()&&(a.startTime=c.now()-a._runTime,g.removePausedAnim(a),g.saveRunningAnim(a),a.__waitTimeout?a.__waitTimeout=
setTimeout(function(){a.stop(!0)},a.__totalTime):(a.beforeResume(),a.doStart()));return a},beforeResume:b,run:function(){var a;a=this.config.queue;!1===a?this.runInternal():(a=f.queue(this.node,a,this),1===a.length&&this.runInternal());return this},stop:function(a){var b=this.node,e=this.config.queue;if(this.isResolved()||this.isRejected())return this;this.__waitTimeout&&(clearTimeout(this.__waitTimeout),this.__waitTimeout=0);if(!this.isRunning()&&!this.isPaused())return!1!==e&&f.remove(b,e,this),
this;this.doStop(a);g.removeRunningAnim(this);g.removePausedAnim(this);var h=this.defer;if(a){var i,a=this.config.complete;c.isEmptyObject(i=this._backupProps)||d.css(this.node,i);a&&a.call(this);h.resolve([this])}else h.reject([this]);!1!==e&&(b=f.dequeue(b,e))&&b[0]&&b[0].runInternal();return this}});h.Utils=g;h.Q=f;return h});
